{% extends 'base.html' %}
{% load timezone %}
{% block title %}{{ snippet.title }} - {{ snippet.get_language.name }} - Snipperize{% endblock %}
{% block meta %}
<meta name="keywords" content="{{ snippet.get_language.name}} snippet, {{ snippet.get_language.name}}, {{ snippet.language }}, {{ snippet.language }} snippet, {% for tag in snippet.get_tags %}{{ tag.name }} snippet{% if not forloop.last %}, {% endif %}{% endfor %}, {% for tag in snippet.get_tags %}{{ tag.name }}{% if not forloop.last %}, {% endif %}{% endfor %}" />
<meta name="description" content="{{ snippet.title }}. This is a {{ snippet.get_language.name}} snippet, talking about {% for tag in snippet.get_tags %}{{ tag.name }}{% ifequal forloop.revcounter0 1 %} and {% else %}{% if not forloop.last %}, {% endif %}{% endifequal %}{% endfor %}" />
{% endblock %}
{% block css %}
<link type="text/css" href="/media/css/shCore.css?v=200906211852" rel="stylesheet">
<link type="text/css" href="/media/css/shThemeDefault.css?v=200906211852" rel="stylesheet">
{% endblock %}
{% block js %}
<script type="text/javascript" src="/media/js/shCore.js?v=200906211852"></script>
<script type="text/javascript">
SyntaxHighlighter.config.clipboardSwf = '/media/img/clipboard.swf';
SyntaxHighlighter.all();
</script>
{% endblock %}
{% block promo %}
<div class="promo green">This is a <a href="{% url language_snippets snippet.language %}" title="{{ snippet.get_language.name}} snippets">{{ snippet.get_language.name}}</a> snippet, talking about {% for tag in snippet.get_tags %}<code><a href="{% url language_tag_snippets snippet.language tag.get_escape_name tag.key.id %}" title="{{snippet.get_language.name}} {{ tag.name }} snippets">{{ tag.name }}</a></code>{% ifequal forloop.revcounter0 1 %} and {% else %}{% if not forloop.last %}, {% endif %}{% endifequal %}{% endfor %}</div>
<div class="promo orange"><a href="{% url language_snippets snippet.language %}" title="{{ snippet.get_language.name}} snippets">{{ snippet.get_language.name}}</a>: 
{% for tag in snippet.get_tags %}<code><a href="{% url language_tag_snippets snippet.language tag.get_escape_name tag.key.id %}" title="{{ snippet.get_language.name }} {{ tag.name }} snippets">{{ tag.name }}</a></code>{% if not forloop.last %}, {% endif %}{% endfor %}</div>
{% endblock %}
{% block body_content %}
{% if subversions %}
<div class="side-box">
<div class="relevent_tags">
    <h2>Versions</h2>
    <ul>
        {% for subversion in subversions %}
        <li><a href="{{ subversion.get_absolute_url }}" title="{{ snippet.title }}, version {{ subversion.title }}">{{ subversion }}</a></li>
        {% endfor %}
    </ul>
</div>
</div>
{% endif %}
<div class="main-box">
<h2>{% ifequal snippet.author.email request.current_user.email %}<span class="editsection">[<a href="{{ snippet.get_edit_url }}" title="edit this snippet">edit</a>]</span><span class="deletesection">[<a href="{{ snippet.get_delete_url }}" title="delete this snippet">delete</a>]</span>{% endifequal %}<span class="mw-headline"> {{ snippet.title }} </span></h2>
{% if snippet.private %}
{% ifnotequal snippet.author.email request.current_user.email %}
This snippet is set to be private only, if you are interested in this script, please contact the author.
{% else %}
<pre class="brush: {{ snippet.language }};">{{ snippet.code }}</pre>
{% if snippet.url %}URL: <a href="{{ snippet.url }}" rel="nofollow" target="_blank" class="external">{{ snippet.url }}</a><br/>{% endif %}
{% if snippet.comment %}{{ snippet.markdown_comment|safe }}{% endif %}
{% endifnotequal %}
{% else %}
<pre class="brush: {{ snippet.language }};">{{ snippet.code }}</pre>
{% if snippet.url %}URL: <a href="{{ snippet.url }}" rel="nofollow" target="_blank" class="external">{{ snippet.url }}</a><br/>{% endif %}
{% if snippet.comment %}{{ snippet.markdown_comment|safe }}{% endif %}
{% endif %}
<p>Created by <a href="{{ snippet.author.get_absolute_url }}" title="{{ snippet.author.user.nickname }}'s snippets">{{ snippet.author.user.nickname }}</a> ({% ifnotequal snippet.elapsed.days 0 %}{{ snippet.elapsed.days }} days, {% endifnotequal %}{{ snippet.elapsed.hours|floatformat:2 }} hours ago)</p>
<div class="comment-box">
<div>
{% if request.current_user %}
<form name="commentForm" id="commentForm" method="post" action="{{ snippet.get_absolute_url }}">
<p class="textarea"><label for="commentContent">Message:</label><textarea id="commentContent" name="commentContent"></textarea></p>
<p><input type="submit" class="submit" value="Leave a mesage"/></p>
</form>
{% else %}
Do you want to leave a message? Please <a href="{% url signin %}" title="sign in">login</a> first.
{% endif %}
</div>
{% if comments %}
<ul class="comments">
	{% for c in comments %}
	<li>
		<a href="{{ c.author.get_absolute_url }}" title="{{ c.author.user.nickname }}'s snippets">{{ c.author }}</a> said: {{ c.content }}<small>({% ifnotequal c.elapsed.days 0 %}{{ c.elapsed.days }} days, {% endifnotequal %}{{ c.elapsed.hours|floatformat:2 }} hours ago)</small>
	</li>
	{% endfor %}
</ul>
{% endif %}
</div>
</div>
{% endblock %}